'''
Created on Mar 17, 2012

@author: phuongdongbk
'''
import string
import sys

inputFile = raw_input("Nhap file input:")

try:
    f = open(inputFile,"r")
except IOError,e :
    print e
    sys.exit()
outputFile = raw_input("Nhap file output:")
fout = open(outputFile, "w")
for line in f:
    newtext =""
    for i in line:
        if i == string.lower(i):
            newtext+= string.upper(i)
        else:
            newtext+= string.lower(i)
    fout.write(newtext)
